﻿// Copyright (c) egmkang wang. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace XServer.Record
{
    using System;
    using MySql.Data.MySqlClient;
    using XServer.SDK;
    using Dapper;

    public sealed partial class MysqlUtils
    {
        public static string DBName = "test";
        public static string DBIpAddr = "192.168.16.102";
        public static string DBPort = "3306";
        public static string UserName = "root";
        public static string Password = "1q2w3e";

        /// <summary>
        /// 返回一个MySQLConnection, 需要自己Dispose
        /// </summary>
        /// <returns></returns>
        public static MySqlConnection GetConn()
        {
            string connString = $"server={DBIpAddr};port={DBPort};database={DBName};user={UserName};password={Password}";
            return new MySqlConnection(connString);
        }
    }
}
